import { reqCategoryData } from '@/api/category'
Page({
  data: {
    categoryList: [],
    activeIndex: 0
  },
  async getCategoryData() {
    const res = await reqCategoryData()
    // console.log(res)
    this.setData({
      categoryList: res.data
    })
  },
  onLoad: function () {
    this.getCategoryData()
  },
  PageChange(event) {
    // console.log(event)
    const { index } = event.currentTarget.dataset
    this.setData({
      activeIndex: index
    })
  }
})
